package com.parktech.sun.domain.model.industryinfo;

import com.parktech.sun.domain.model.BaseEntity;
import com.parktech.sun.domain.model.ContentEntity;
import com.parktech.sun.domain.model.news.NewsAttachment;

import javax.persistence.*;
import java.util.List;

/**
 * User: Think
 * Date: 11-1-13
 * Time: 下午8:49
 */
@Entity
@DiscriminatorValue("10")
public class IndustryInfo extends ContentEntity {

    private String imageName;

    private List<IndustryInfoAttachment> attachmentList;

    private IndustryInfoCategory category;

    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy = "industryInfo", cascade = CascadeType.ALL)
    public List<IndustryInfoAttachment> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<IndustryInfoAttachment> attachmentList) {
        this.attachmentList = attachmentList;
    }

    @ManyToOne
    public IndustryInfoCategory getCategory() {
        return category;
    }

    public void setCategory(IndustryInfoCategory category) {
        this.category = category;
    }

    @Transient
    public String getLocation() {
        return "industryinfos";
    }
}
